import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("idx_form_id", ["formId"], {})
@Entity("rrz_form_data", { schema: "rrzcms" })
export class RrzFormData {
  @PrimaryGeneratedColumn({
    type: "bigint",
    name: "id",
    comment: "表id",
    unsigned: true,
  })
  id: string;

  @Column("int", {
    name: "form_id",
    nullable: true,
    comment: "表单ID",
    unsigned: true,
    default: () => "'0'",
  })
  formId: number | null;

  @Column("varchar", {
    name: "form_name",
    nullable: true,
    comment: "表单名称",
    length: 255,
  })
  formName: string | null;

  @Column("longtext", { name: "content", nullable: true, comment: "提交内容" })
  content: string | null;

  @Column("varchar", {
    name: "ip",
    nullable: true,
    comment: "提交人IP",
    length: 255,
  })
  ip: string | null;

  @Column("int", {
    name: "add_time",
    nullable: true,
    comment: "提交时间",
    unsigned: true,
  })
  addTime: number | null;
}
